package _4ChapterFore._2ConsolidateConditionalExpression;

public class Main {
    public int fun1(int count,int base,int age){
        if (count<1){
            return 0;
        }
        if (base == 0){
            return 0;
        }
        if (age<18){
            return 0;
        }
        return 1;
    }
    public int fun2(int count,int base,int age){
        if (count<1 || base == 0 || age<18){
            return 0;
        }
        return 1;
    }

    public int fun3(int count,int base,int age){
        if (noBuy(count,base,age)){
            return 0;
        }
        return 1;
    }

    private boolean noBuy(int count,int base,int age){
        return count<1 || base == 0 || age<18;
    }

}
